"""Bazel MODULE file for https://github.com/stackb/rules_proto"""

module(
    name = "build_stack_rules_proto",
    version = "4.0.0",
    compatibility_level = 1,
)

# -------------------------------------------------------------------
# Bazel Dependencies
# -------------------------------------------------------------------

PROTOBUF_VERSION = "32.0"

bazel_dep(name = "zlib", version = "1.3.1.bcr.6")
bazel_dep(name = "rules_shell", version = "0.6.1")
bazel_dep(name = "rules_scala", version = "7.0.0", repo_name = "io_bazel_rules_scala")
bazel_dep(name = "rules_python", version = "1.5.3")
bazel_dep(name = "rules_proto", version = "7.1.0")
bazel_dep(name = "rules_pkg", version = "1.1.0")
bazel_dep(name = "rules_license", version = "1.0.0")
bazel_dep(name = "rules_jvm_external", version = "6.8")
bazel_dep(name = "rules_java", version = "8.15.1")
bazel_dep(name = "rules_go", version = "0.57.0", repo_name = "io_bazel_rules_go")
bazel_dep(name = "rules_foreign_cc", version = "0.15.0")  # specified to ensure more recent version than @grpc/@opencensus-cpp/@google_benchmark
bazel_dep(name = "rules_cc", version = "0.2.0")
bazel_dep(name = "protobuf", version = PROTOBUF_VERSION, repo_name = "com_google_protobuf")
bazel_dep(name = "package_metadata", version = "0.0.5")
bazel_dep(name = "grpc", version = "1.74.1", repo_name = "com_github_grpc_grpc")
bazel_dep(name = "grpc-java", version = "1.71.0", repo_name = "io_grpc_grpc_java")
bazel_dep(name = "gazelle", version = "0.45.0", repo_name = "bazel_gazelle")
bazel_dep(name = "bazel_skylib", version = "1.8.1")
bazel_dep(name = "bazel_features", version = "1.35.0")
bazel_dep(name = "aspect_rules_ts", version = "3.7.0")
bazel_dep(name = "aspect_rules_js", version = "2.5.0")
bazel_dep(name = "aspect_bazel_lib", version = "2.21.1")
bazel_dep(name = "abseil-cpp", version = "20250814.0")

# -------------------------------------------------------------------
# Dev  Dependencies
# -------------------------------------------------------------------

bazel_dep(name = "buildifier_prebuilt", version = "8.2.0.2", dev_dependency = True)

# -------------------------------------------------------------------
# Http Archives
# -------------------------------------------------------------------

http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

# Commit: 861c8020a5c0cba9b7cdf915dffde96a4421a1f4
# Date: 2025-08-15 21:09:45 +0000 UTC
# URL: https://github.com/protocolbuffers/protobuf-javascript/commit/861c8020a5c0cba9b7cdf915dffde96a4421a1f4
#
# Bump module versions for 4.0.0 release
# Size: 401540 (402 kB)
http_archive(
    name = "com_google_protobuf_javascript",
    sha256 = "6c009ad82a356c58c75fc3548c8d8f1f7eb56409a46d0d4cce4f779703f89ce2",
    strip_prefix = "protobuf-javascript-861c8020a5c0cba9b7cdf915dffde96a4421a1f4",
    urls = ["https://github.com/protocolbuffers/protobuf-javascript/archive/861c8020a5c0cba9b7cdf915dffde96a4421a1f4.tar.gz"],
)

http_archive(
    name = "com_github_grpc_grpc_node_packages_grpc_tools_src",
    build_file_content = """
cc_library(
    name = "grpc_plugin_support",
    srcs = ["node_generator.cc"],
    hdrs = [
        "config.h",
        "config_protobuf.h",
        "generator_helpers.h",
        "node_generator.h",
        "node_generator_helpers.h",
    ],
    deps = ["@com_google_protobuf//:protoc_lib"],
)
cc_binary(
    name = "grpc_node_plugin",
    srcs = ["node_plugin.cc"],
    visibility = ["//visibility:public"],
    deps = [":grpc_plugin_support"],
)
""",
    sha256 = "7fbe9d04e45420c3c2e02456c0275fa8716fa894c48525b9a8f7db9ac0b4acb0",
    strip_prefix = "grpc-node-aeb42733d861883b82323e2dc6d1aba0e3a12aa0/packages/grpc-tools/src",
    urls = ["https://github.com/grpc/grpc-node/archive/aeb42733d861883b82323e2dc6d1aba0e3a12aa0.tar.gz"],
)

http_archive(
    name = "com_github_stackb_grpc_js",
    sha256 = "33042aa893625ec5bf6d59bf38b3954e5558b7e549b1cb2eeee66cd2ccf8ab29",
    strip_prefix = "grpc.js-c938ee76ee462abf4f83d758f63d52f03fa24c7c",
    urls = ["https://github.com/stackb/grpc.js/archive/c938ee76ee462abf4f83d758f63d52f03fa24c7c.tar.gz"],
)

# -------------------------------------------------------------------
# Http Files
# -------------------------------------------------------------------

http_file = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")

PROTOC_GEN_GRPC_WEB_VERSION = "1.5.0"

[
    http_file(
        name = "github_com_grpc_grpc_web_releases_download_protoc_gen_grpc_web_" + asset["arch"],
        executable = True,
        sha256 = asset["sha256"],
        urls = ["https://github.com/grpc/grpc-web/releases/download/{version}/protoc-gen-grpc-web-{version}-{arch}".format(
            arch = asset["arch"],
            version = asset["version"],
        )],
    )
    for asset in [
        {
            "version": PROTOC_GEN_GRPC_WEB_VERSION,
            "arch": "darwin-aarch64",
            "sha256": "a12b759629b943ebac5528f58fac5039d9aa2fb7abb9e9684d1b481b35afbfc6",
        },
        {
            "version": PROTOC_GEN_GRPC_WEB_VERSION,
            "arch": "darwin-x86_64",
            "sha256": "1fa3ef92194d06c03448a5cba82759e9773e43d8b188866a1f1d4fc23bb1ecb7",
        },
        {
            "version": PROTOC_GEN_GRPC_WEB_VERSION,
            "arch": "linux-x86_64",
            "sha256": "2e6e074497b221045a14d5a54e9fc910945bfdd1198b12b9fc23686a95671d64",
        },
    ]
]

# -------------------------------------------------------------------
# Configuration: Go
# -------------------------------------------------------------------

go_sdk = use_extension("@io_bazel_rules_go//go:extensions.bzl", "go_sdk")
go_sdk.from_file(go_mod = "//:go.mod")

# Known to exist since it is instantiated by rules_go itself.
use_repo(
    go_sdk,
    go_sdk = "go_default_sdk",
)

go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//:go.mod")
use_repo(
    go_deps,
    "bazel_gazelle_go_repository_config",  # keep
    "com_github_bazelbuild_buildtools",
    "com_github_bmatcuk_doublestar",
    "com_github_emicklei_proto",
    "com_github_gogo_protobuf",
    "com_github_google_go_cmp",
    "com_github_pmezard_go_difflib",
    "com_github_stretchr_testify",
    "in_gopkg_yaml_v3",
    "net_starlark_go",
    "org_golang_google_grpc",
    "org_golang_google_grpc_cmd_protoc_gen_go_grpc",
    "org_golang_google_protobuf",
)

# -------------------------------------------------------------------
# Configuration: Gazelle
# -------------------------------------------------------------------

non_module_deps = use_extension("@bazel_gazelle//internal/bzlmod:non_module_deps.bzl", "non_module_deps")
use_repo(
    non_module_deps,
    "bazel_gazelle_go_repository_cache",
    "bazel_gazelle_go_repository_tools",
    "bazel_gazelle_is_bazel_module",
)

proto_repository_tools = use_repo_rule("//rules/private:proto_repository_tools.bzl", "proto_repository_tools")

proto_repository_tools(
    name = "proto_repository_tools",
    go_cache = "@bazel_gazelle_go_repository_cache//:go.env",
)

# -------------------------------------------------------------------
# Configuration: Scala
# -------------------------------------------------------------------

# Selects the Scala version and other configuration parameters.
#
# 2.12 is the default version. Use other versions by passing them explicitly, as
# illustrated below.
scala_config = use_extension(
    "@io_bazel_rules_scala//scala/extensions:config.bzl",
    "scala_config",
)
scala_config.settings(
    enable_compiler_dependency_tracking = True,
    scala_version = "2.12.20",
)

scala_deps = use_extension(
    "@io_bazel_rules_scala//scala/extensions:deps.bzl",
    "scala_deps",
)
scala_deps.scala()

# -------------------------------------------------------------------
# Configuration: NPM Deps
# -------------------------------------------------------------------

rules_ts_ext = use_extension("@aspect_rules_ts//ts:extensions.bzl", "ext", dev_dependency = True)
rules_ts_ext.deps()
use_repo(rules_ts_ext, "npm_typescript")

npm = use_extension(
    "@aspect_rules_js//npm:extensions.bzl",
    "npm",
)
npm.npm_translate_lock(
    name = "npm_ts_proto",
    generate_bzl_library_targets = True,
    npmrc = "//:.npmrc",
    pnpm_lock = "//:pnpm-lock.yaml",
    verify_node_modules_ignored = "//:.bazelignore",
)
use_repo(npm, "npm_ts_proto")

# -------------------------------------------------------------------
# Configuration: Maven Deps
# -------------------------------------------------------------------

maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install(
    name = "maven",
    # these artifacts are specified only to disambiguate versions between
    # multiple contributing modules (bazel mod warnings)
    artifacts = [
        "com.google.code.findbugs:jsr305:3.0.2",
        "com.google.code.gson:gson:2.11.0",
        "com.google.errorprone:error_prone_annotations:2.30.0",
        "com.google.guava:guava:32.0.1-jre",
    ],
    known_contributing_modules = [
        "build_stack_rules_proto",
        "grpc-java",
        "protobuf",
    ],
    lock_file = "maven_install.json",
)
maven.install(
    name = "maven_scala",
    artifacts = [
        "com.thesamet.scalapb:compilerplugin_2.12:0.11.17",
        "com.thesamet.scalapb:lenses_2.12:0.11.5",
        "com.thesamet.scalapb:scalapb-json4s_2.12:0.12.0",
        "com.thesamet.scalapb:scalapb-runtime_2.12:0.11.5",
        "com.thesamet.scalapb:scalapb-runtime-grpc_2.12:0.11.5",
    ],
    lock_file = "rules_jvm_external~~maven~maven_scala_install.json",
    repositories = ["https://repo1.maven.org/maven2"],
)
maven.install(
    name = "maven_akka",
    artifacts = [
        "com.lightbend.akka.grpc:akka-grpc-codegen_2.12:2.1.3",
        "com.lightbend.akka.grpc:akka-grpc-runtime_2.12:2.1.3",
    ],
    fetch_sources = True,
    lock_file = "//:maven_akka_install.json",
    repositories = ["https://repo1.maven.org/maven2"],
)
maven.install(
    name = "maven_zio",
    artifacts = [
        "com.thesamet.scalapb.zio-grpc:zio-grpc-codegen_2.12:0.6.0",
    ],
    fetch_sources = True,
    lock_file = "//:maven_zio_install.json",
    repositories = ["https://repo1.maven.org/maven2"],
)
use_repo(
    maven,
    "com_google_protobuf_protobuf_java_3_19_6",
    "com_thesamet_scalapb_compilerplugin_2_12_0_11_13",
    "maven",
    "maven_akka",
    "maven_scala",
    "maven_zio",
)

# -------------------------------------------------------------------
# Configuration: Protobuf Deps
# -------------------------------------------------------------------

proto_language_directives = [
    "gazelle:proto_language %s enable true" % name
    for name in [
        "cpp",
        "descriptor",
        "go",
        "java",
        "python",
        "scala",
    ]
]

proto_repository = use_extension("@build_stack_rules_proto//extensions:proto_repository.bzl", "proto_repository", dev_dependency = True)
proto_repository.archive(
    name = "protobufapis",
    build_directives = [
        "gazelle:exclude google/protobuf/bridge",
        "gazelle:exclude google/protobuf/compiler/ruby",
        "gazelle:exclude google/protobuf/util/internal/testdata",
        "gazelle:exclude testdata",
        "gazelle:proto_go_modules_index_kind proto_go_library",
    ] + proto_language_directives,
    build_file_generation = "clean",
    build_file_proto_mode = "file",
    cfgs = ["@//:rules_proto_config.yaml"],
    deleted_files = [
        "google/protobuf/*test*.proto",
        "google/protobuf/*unittest*.proto",
        "google/protobuf/late*.proto",
        "google/protobuf/sample*.proto",
        "google/protobuf/cpp_features.proto",
        "google/protobuf/internal_options.proto",
        "google/protobuf/compiler/cpp/*test*.proto",
        "google/protobuf/util/*test*.proto",
        "google/protobuf/util/*unittest*.proto",
        "google/protobuf/util/json_format*.proto",
    ],
    sha256 = "bb1fd58473c47c747a3f00fc45ced1d562bba4bf645db07cc889fe86dee279ca",
    strip_prefix = "protobuf-4fbd1111a292d04746c732573025e3251de0bb9c/src",
    urls = ["https://github.com/protocolbuffers/protobuf/archive/4fbd1111a292d04746c732573025e3251de0bb9c.tar.gz"],
)

# Commit: 60e1300d4a0b60b85b3df167ddc4062ac7cc4f44
# Date: 2025-09-08 18:27:45 +0000 UTC
# URL: https://github.com/googleapis/googleapis/commit/60e1300d4a0b60b85b3df167ddc4062ac7cc4f44
#
# feat: release initial client libraries for Cloud Location Finder (https://cloud.google.com/location-finder)
#
# Clients can now use this v1 client library via the following methods: ListCloudLocations, GetCloudLocation, SearchCloudLocations
#
# PiperOrigin-RevId: 804516757
# Size: 11515047 (12 MB)
proto_repository.archive(
    name = "googleapis",
    build_directives = [
        "gazelle:exclude google/ads/googleads/v19/services",
        "gazelle:exclude google/ads/googleads/v20/services",
        "gazelle:exclude google/ads/googleads/v21/services",
        "gazelle:exclude google/ads/googleads/v7/services",
        "gazelle:exclude google/ads/googleads/v8/services",
        "gazelle:exclude google/cloud/recommendationengine/v1beta1",
        "gazelle:exclude google/devtools/containeranalysis/v1beta1",
        "gazelle:exclude google/example",
        "gazelle:exclude google/maps/weather/v1",
        "gazelle:proto_go_modules_index_kind proto_go_library",
    ] + proto_language_directives,
    build_file_generation = "clean",
    build_file_proto_mode = "file",
    cfgs = ["//:rules_proto_config.yaml"],
    imports = ["@protobufapis//:imports.csv"],
    reresolve_known_proto_imports = True,
    sha256 = "b1f729e116312e1bed9a6c0b812e8d6071755dcf93ff4f665c07bbf517dd61a6",
    strip_prefix = "googleapis-60e1300d4a0b60b85b3df167ddc4062ac7cc4f44",
    urls = ["https://github.com/googleapis/googleapis/archive/60e1300d4a0b60b85b3df167ddc4062ac7cc4f44.tar.gz"],
)

# Commit: 3df4b0cc65e3e67ee84c124484be64de63779ae7
# Date: 2025-08-23 17:33:43 +0000 UTC
# URL: https://github.com/scalapb/ScalaPB/commit/3df4b0cc65e3e67ee84c124484be64de63779ae7
#
# Fix organization name
# Size: 993390 (993 kB)
proto_repository.archive(
    name = "scalaapis",
    build_directives = ["gazelle:proto_language scala enabled true"],
    build_file_generation = "clean",
    build_file_proto_mode = "file",
    cfgs = ["//:rules_proto_config.yaml"],
    sha256 = "2f8985d6f55904fa9cc3f73a419818c2ce71ccf98b2d310678da3f7e16bf4d19",
    strip_prefix = "ScalaPB-3df4b0cc65e3e67ee84c124484be64de63779ae7/protobuf",  # the typical importpath is 'scalapb/scalapb.proto', so strip the prefix up to that dir
    urls = ["https://github.com/scalapb/ScalaPB/archive/3df4b0cc65e3e67ee84c124484be64de63779ae7.tar.gz"],
)
use_repo(
    proto_repository,
    "googleapis",
    "protobufapis",
    "scalaapis",
)

# -------------------------------------------------------------------
# Toolchains
# -------------------------------------------------------------------

register_toolchains("@build_stack_rules_proto//toolchain:standard")
